switch (state) {
  case 0:
    LOAD(linkUrl);
  case 1:
    // locate image by its id
    var imageId = "XXX";
    var image = document.getElementById(imageId);
    RETURN(image.src);
}